<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>FormatDate</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">FormatDate()</font></b></p>
<p><b>Syntax</b></p><blockquote>

Text$ = <font color="#006666"><b>FormatDate</b></font>(Mask$, Date)</blockquote>

</blockquote>
<b>Description</b><br><blockquote>



Returns a string representation of the given Date. 

 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>Mask$</i></td>
<td width="90%"> 
 
The mask used to format the date. The following tokens in the mask string will be replaced according to the given date: 
 
<pre><font face="Courier New, Courier, mono"size="2">  %yyyy: Will be replaced by the year value, on 4 digits.
  %yy: Will be replaced by the year value, on 2 digits.
  %mm: Will be replaced by the month value, on 2 digits.
  %dd: Will be replaced by the day value, on 2 digits.
  %hh: Will be replaced by the hour value, on 2 digits.
  %ii: Will be replaced by the minute value, on 2 digits.
  %ss: Will be replaced by the second value, on 2 digits.
</font></pre>

</td></tr>
<tr><td><i>Date</i></td>
<td> 
 
The date value to use. 

 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>



Returns the mask string with all tokens replaced by the date values. 

 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">
  <b><font color="#006666">Debug</font></b> <font color="#006666">FormatDate</font>("Y=%yyyy, M= %mm, D=%dd",<font color="#006666"> Date</font>()) <font color="#006666">; Will display the actual date with</font>
                                                     <font color="#006666">; the form "Y=2010, M=01, D=07"</font>

  <b><font color="#006666">Debug</font></b> <font color="#006666">FormatDate</font>("%mm/%dd/%yyyy",<font color="#006666"> Date</font>()) <font color="#006666">; Will display the actual date with</font>
                                            <font color="#006666">; the form "01/07/2010"</font>

  <b><font color="#006666">Debug</font></b> <font color="#006666">FormatDate</font>("%hh:%ii:%ss",<font color="#006666"> Date</font>())   <font color="#006666">; Will display the time using the 00:00:00 format</font>

</font></pre>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="date.html">Date()</a>, <a href="parsedate.html">ParseDate()</a> 

</Blockquote><p><b>Supported OS  </b><Blockquote>All</Blockquote></p><center>&lt;- <a href=dayofyear.html>DayOfYear()</a> - <a href=index.html>Date Index</a> - <a href=hour.html>Hour()</a> -&gt;



</body></html>